Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HEBO sampler supporting Define-by-Run manner, maximization, parallelization, and constant_liar #195

Closed
wants to merge 19 commits into from

Conversation

eukaryo
Copy link
Contributor

@eukaryo eukaryo commented Dec 4, 2024

Contributor Agreements

Please read the contributor agreements and if you agree, please click the checkbox below.

  • I agree to the contributor agreements.

Tip

Please follow the Quick TODO list to smoothly merge your PR.

Motivation

I would like to see a HEBO implementation that can drop-in replacement of Sampler in Optuna code that is written in Define-by-Run (its search space is not conditional).

I also want it to support parallelization.

Description of the changes

Add another package of HEBO.

TODO List towards PR Merge

Please remove this section if this PR is not an addition of a new package.
Otherwise, please check the following TODO list:

  • Copy ./template/ to create your package
  • Replace <COPYRIGHT HOLDER> in LICENSE of your package with your name
  • Fill out README.md in your package
  • Add import statements of your function or class names to be used in __init__.py
  • (Optional) Add from __future__ import annotations at the head of any Python files that include typing to support older Python versions
  • Apply the formatter based on the tips in README.md
  • Check whether your module works as intended based on the tips in README.md

@eukaryo eukaryo added the new-package New packages label Dec 4, 2024
Copy link
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!
I left some comments!

@@ -0,0 +1,3 @@
optuna
optunahub
hebo@git+https://github.com/huawei-noah/[email protected]#subdirectory=HEBO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using hebo?

Suggested change
hebo@git+https://github.com/huawei-noah/HEBO.git@v0.3.6#subdirectory=HEBO
hebo==0.3.6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exact same code as the preceding HEBO package, so I would prefer to maintain it.

package/samplers/hebo_base_sampler/sampler.py Outdated Show resolved Hide resolved
package/samplers/hebo_base_sampler/sampler.py Outdated Show resolved Hide resolved
package/samplers/hebo_base_sampler/sampler.py Show resolved Hide resolved
Comment on lines 43 to 44
if len([t for t in trials if t.state == TrialState.COMPLETE]) < 1:
return {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use hebo.suggest even if we do not have completed trials, because hebo.suggest uses qmc if I remember correctly.

Copy link
Contributor Author

@eukaryo eukaryo Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sampler does not call hebo.suggest() here because it needs to know search space by running the first trial.
(It uses BaseSampler, so search space is not given.)
I have added comment about this in the code.

package/samplers/hebo_base_sampler/sampler.py Show resolved Hide resolved
@eukaryo eukaryo marked this pull request as draft December 4, 2024 03:39
@eukaryo eukaryo marked this pull request as ready for review December 4, 2024 04:30
@eukaryo eukaryo marked this pull request as draft December 4, 2024 05:01
@eukaryo
Copy link
Contributor Author

eukaryo commented Dec 4, 2024

I will close this PR and make new PR, which adds these functionalities to existing HEBO package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-package New packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants